<template>
  <div>
    <RemoteSignaturePad
      :key="id || 0"
      ref="signaturePadRef"
      :model-value="sign || ''"
      :nickname="nickname || ''"
      :taskId="route.query.taskId as string"
      :expireDate="expireDate || ''"
      :title="`签名【${nickname || ''}】`"
    />
  </div>
</template>

<script lang="ts" setup>
import RemoteSignaturePad from '@/views/project/list/RemoteSignaturePad.vue'
import { ref } from 'vue'
import { useRoute } from 'vue-router'
import * as UserApi from '@/api/system/user'
const route = useRoute()

const nickname = ref('')
const sign = ref('')
const expireDate = ref('')
const id = ref('')

onMounted(async () => {
  console.log('handleSignConfirm', route.query.taskId)
  const data = await UserApi.getSignTask(route.query.taskId as string)
  nickname.value = data.nickname
  id.value = data.id
  expireDate.value = data.expireDate
})
</script>

<style lang="scss" scoped></style>
